<?php session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Information (4/4)</title>
<script type="text/javascript" src="validateInformation.js" ></script>


<?php
require_once 'ViolationView.php';
if(isset($_POST['Done']))
{
	$f = ViolationView::checkDuplicate($_SESSION['snum']);
	if($f){
		echo'<script>alert("This violation instance already exists.")</script>';
	}else{
		ViolationView::insertViolation($_SESSION['snum'],$_SESSION['vdate'],$_SESSION['nature'],$_SESSION['action'],$_SESSION['rdate']);
	}




}
?>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>

<body>
<table width="100%" border="0" cellpadding="1">
 
  <tr>
    <td>&nbsp;</td>
    <td class="subBanner"><strong> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Resident's Basic Information Form</strong></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><form id="form1" name="form1" method="post" action="" >
      <table width="100%" border="0" cellpadding="1">
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </strong>&nbsp;</td>
          <td id="lname2" class="error">&nbsp;</td>
        </tr>
        <tr>
          <td class="confirm">Student Number</td>
          <td width="1%" class="confirm1">&nbsp;</td>
          <td width="31%" class="confirm1"><?php echo $_SESSION['snum'] ?></td>
          <td width="23%" id="gname" class="error">&nbsp;</td>
        </tr>
		<tr>
          <td class="confirm">Date of Violation</td>
          <td width="1%" class="confirm1">&nbsp;</td>
          <td width="31%" class="confirm1"><?php echo strtoupper($_SESSION['vdate']) ?></td>
          <td width="23%" id="gname" class="error">&nbsp;</td>
        </tr>
		<tr>
          <td class="confirm">Nature</td>
          <td width="1%" class="confirm1">&nbsp;</td>
          <td width="31%" class="confirm1"><?php echo strtoupper($_SESSION['nature']) ?></td>
          <td width="23%" id="gname" class="error">&nbsp;</td>
        </tr>
		<tr>
          <td class="confirm">Action Taken</td>
          <td width="1%" class="confirm1">&nbsp;</td>
          <td width="31%" class="confirm1"><?php echo strtoupper($_SESSION['action']) ?></td>
          <td width="23%" id="gname" class="error">&nbsp;</td>
        </tr>
		<tr>
          <td class="confirm">Date Reported</td>
          <td width="1%" class="confirm1">&nbsp;</td>
          <td width="31%" class="confirm1"><?php echo strtoupper($_SESSION['rdate']) ?></td>
          <td width="23%" id="gname" class="error">&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td><input type="submit" name="Done" id="Done" value="Confirm Resident" /></td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
      </table>
    </form></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
</body>
</html>
